package edu.sctu.practice.class01.fengleilin.assign03.test01;

/**
 * Created by fll on 2015/10/22.
 */

/**
 * Rectangle类是一个子类，表示一个矩形
 */
public class Rectangle extends GeometricObject {

    double height = 8;//定义矩形的高
    double width = 6;//定义矩形的宽

    /**
     * 构造方法
     *
     * @param color
     */
    public Rectangle(String color) {
        super(color);
    }

    @Override
    public double findArea() {

        double object1 = height * width;
        System.out.println(object1);

        return object1;

    }

    @Override
    public double findPerimeter() {

        double rectanglePerimeter = (height + width) * 2;
        System.out.println(rectanglePerimeter);
        return rectanglePerimeter;

    }
}
